<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="IndexUsuario.xhtml">

	<ui:define name="conteudo">
		<f:loadBundle basename="br.ucb.jogo.recursos.messages" var="msg" />
		<p:panel styleClass="FundoPaginaUsuario">
			<h:form id="form">
				<br/><br/><br/>
				<center>
				
						<p:dataTable emptyMessage="#{msg.NENHUM_ITEM}" var="item"
							value="#{itensManagedBean.itens}" rowKey="#{item.nome}"
							paginator="true" rows="10"
							filteredValue="#{itensManagedBean.filtroItens}" id="TableItens" styleClass="PainelTrabalho">
		
							<f:facet name="header">
								<h:outputText value="#{msg.LISTAR_ITEM}" />
							</f:facet>
		
							<p:column headerText="#{msg.NOME}" sortBy="#{item.nome}"
								filterBy="#{item.nome}" id="nome">
								<h:outputText value="#{item.nome}" />
							</p:column>
		
							<p:column headerText="#{msg.PRECO}" sortBy="#{item.preco}" id="preco">
								<h:outputText value="#{item.preco}" />
							</p:column>
		
							<p:column headerText="#{msg.LEVEL_NECESSARIO}"
								sortBy="#{item.levelNecessario}" id="levelNecessario">
								<h:outputText value="#{item.levelNecessario}" />
							</p:column>
		
							<p:column headerText="#{msg.FORCA}" sortBy="#{item.forca}" id="forca">
								<h:outputText value="#{item.forca}" />
							</p:column>
		
							<p:column headerText="#{msg.AGILIDADE}" sortBy="#{item.agilidade}"
								id="agilidade">
								<h:outputText value="#{item.agilidade}" />
							</p:column>
		
							<p:column headerText="#{msg.DEFESA}" sortBy="#{item.defesa}" id="defesa">
								<h:outputText value="#{item.defesa}" />
							</p:column>
		
							<p:column headerText="#{msg.MANA}" sortBy="#{item.mana}" id="mana">
								<h:outputText value="#{item.mana}" />
							</p:column>
		
							<p:column headerText="#{msg.COMPRAR_ITEM}" id="compra">
								<p:commandButton action="#{personagemManagedBean.compraItem}" label="#{msg.COMPRAR}" value="#{msg.COMPRAR}" immediate="true">
									<f:setPropertyActionListener target="#{personagemManagedBean.itensSelect}"	value="#{item}" />
								</p:commandButton>
							</p:column>
						</p:dataTable>
					
				</center>
			</h:form>
		</p:panel>
	</ui:define>

</ui:composition>
</html>
